﻿@{
    ViewBag.Title = "Assign to project";
}

<h2>@ViewBag.Title</h2>

@using (Html.BeginForm()) {
  if (ViewData["Error"] != null) {
    var error = (Exception)ViewData["Error"];
    <div class="error">
      @error.Message
    </div>
    <br />
  }

      <fieldset>
        <legend>Resource Assignment</legend>

    <div class="editor-label">
      Role
    </div>
    <div class="editor-field">
      @Html.DropDownList("Role", new SelectList(ProjectTracker.Library.RoleList.GetList(), "Key", "Value"))
    </div>

    <div class="editor-label">
      Project
    </div>
    <div class="editor-field">
      @Html.DropDownList("ProjectId", new SelectList(ProjectTracker.Library.ProjectList.GetProjectList(), "Id", "Name"))
    </div>

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
  @Html.ActionLink("Back to List", "Index", new { id = ViewData["ResourceId"] })
</div>

